#ifndef __SCENEROLEMGR_H__
#define __SCENEROLEMGR_H__
#pragma once

#include <wild/WildConfig.h>
#include <string>
#include <wild/WildArray.h>
#include <wild/SceneRoleEntity.h>

namespace wild
{


//class SceneRoleEntity;


template<class T>
class ScRoleMgrFactory
{
public:
	T* GeneralObject(const char* pcName)
	{
		T* poObj_ = new (T)(pcName);
		return poObj_;
	}
};

class SceneRoleMgr
{
	typedef wild::WildArray<SceneRoleEntity> ENTITY_LIST;
public:
	SceneRoleMgr(const char* pcName="DEF_SCENE");
	virtual ~SceneRoleMgr();
	void Start();
	void Stop();
	int AddEntity(SceneRoleEntity* poEnt,const char* pcName);
	void DelEntity(const char* pcName);
	void DelEntity(int iHandle);
	SceneRoleEntity* GetEntity(const char* pcName);
	SceneRoleEntity* GetEntity(int iHandle);
	int SendMessageToEntity(int iID,Uint uiMsg,int iParam1,char* pcParam2);

	virtual int ComponentProc(Uint uiMsg,int iParam1,char* pcParam2) = 0;

	virtual void OnUpdateFrame() = 0;

	virtual void OnInitialize() = 0;
	virtual void OnFinialize() = 0;



protected:
	


	
	ENTITY_LIST* _poEnties;
	std::string _sScName;


};

}	//	namespace wild
#endif	//	__SCENEROLEMGR_H__
